<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="/struts-tags" prefix="s" %>

<!DOCTYPE html>
<html>
  <head>
    
    <title></title>
	<link rel="stylesheet" type="text/css" href="UI/users/css/common.css"/>
    <link rel="stylesheet" type="text/css" href="UI/users/css/main.css"/>
    <script type="text/javascript" src="UI/users/js/libs/modernizr.min.js"></script>
    <style type="text/css">
    #content_operate_field_button {
	margin-right: 20px;
	margin-left: 20px;
	}
	</style>
<script type="text/javascript">
<script type="text/javascript">
function confirmUpdateGood(){
	var goodskind=document.getElementById("goodskind");
	var price=document.getElementById("price");
	var reg=/^[-\+]?\d+(\.\d+)?$/;
	if(goodskind.value=="-1"){
			alert("商品分类不能为空!");
			return false;
	}else{
		if(reg.test(price.value)){
			return true;
		}else{
			alert("输入正确的价格");
			return false;
		}
	}	
}

</script>
  </head>
  
  <body>
 <s:if test="null==#session.account">
	<s:a href="login.action" align="center"><h2>您不能直接访问网站内部页面,请先登录!</h2></s:a>
</s:if>
<s:else>	
  	        <div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i>
            <span class="crumb-name">首页</span><span class="crumb-step">&gt;</span>
            <a class="crumb-name" href="goodsList">商品管理</a><span class="crumb-step">&gt;</span>
            <span class="crumb-name">修改商品</span>
            </div>
        </div>
        <div class="result-wrap">
            <div class="result-content">
                <form action="updateGood" method="post" onsubmit="return confirmUpdateGood()" enctype="multipart/form-data">
                <s:hidden name="goods.id" id="id"></s:hidden>
                    <table class="insert-tab" width="100%">
                        <tbody><tr>
                            <th width="120"><i class="require-red">*</i>商品类别：</th>
                            <td>
                                <s:select headerKey="-1" headerValue="商品种类" name="goodskind.id" list="goodsKindList" listKey="id" listValue="name" />
                            </td>
                        </tr>
                            <tr>
                                <th><i class="require-red">*</i>商品名称：</th>
                                <td>
                                	<s:textfield name="goods.name" id="name" class="common-text required" size="50" required="required"></s:textfield>
                                </td>
                            </tr>
                            <tr>
                                <th><i class="require-red">*</i>单价(￥)：</th>
                                <td><s:textfield class="common-text required" id="price" name="goods.price" size="50" required="required"></s:textfield>
                                </td>
                            </tr>
                            <tr>
                                <th></th>
                                <td>
                                    <input class="btn btn-primary btn6 mr10" value="提交" type="submit">
                                    <input class="btn btn6" onclick="history.go(-1)" value="返回" type="button">
                                </td>
                            </tr>
                        </tbody></table>
                </form>
            </div>
        </div> 
        
        <%--   			<div>
  			  	<label class="control-group">*分类：</label>
	            <div>
	            	<div >
                    	<s:select name="goodskind.id" list="goodsKindList" listKey="id" listValue="name" />
                    </div>
	            </div>            
	         </div>
	         <div>
	         	<label class="control-group">*商品名称：</label>
	         	<div>
	         		<s:textfield name="goods.name" class="common-text required"></s:textfield>
	         	</div>
	         </div>
	         <div>
	         	<label class="control-group">*单价(￥)：</label>
	         	<div>
	         		<s:textfield class="common-text required" name="goods.price"></s:textfield>
	         	</div>
	         </div>
	         <div>
                    <input class="btn btn-primary btn6 mr10" value="提交" type="submit">
                    <input class="btn btn6" onclick="history.go(-1)" value="返回" type="button">
	          </div> --%>
  </s:else>	
  </body>
</html>
